package ru.passivemoney.manage.messages;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.dukascopy.api.IMessage;

public class MessagesHolder {
	
	private static final Logger logger = LoggerFactory.getLogger(MessagesHolder.class);

	public static final Map<String, IMessage> SHARED_MAP = new ConcurrentHashMap<String, IMessage>();
	
	public static final IMessage get(String key){
		return SHARED_MAP.get(key);
	}
	
	public static final void put(String key, IMessage value){
		logger.info("Put message key - {}, value - {}", key, value);
		SHARED_MAP.put(key, value);
	}
	
	public static final void remove(String key){
		logger.info("Remove message key - {}", key);
		SHARED_MAP.remove(key);
	}
}
